// 通知系统类型定义

export interface NotificationAction {
  id: string
  label: string
  type?: 'primary' | 'secondary' | 'danger'
  handler?: (notification: Notification, action: NotificationAction) => void
  autoClose?: boolean
}

export interface Notification {
  id: string
  type: 'info' | 'success' | 'warning' | 'error'
  title: string
  message?: string
  details?: string
  duration?: number // 自动关闭时间（毫秒），0 表示不自动关闭
  persistent?: boolean // 是否持久化显示
  actions?: NotificationAction[]
  createdAt: number
  onClick?: (notification: Notification) => void
}

export interface NotificationOptions {
  type?: Notification['type']
  title: string
  message?: string
  details?: string
  duration?: number
  persistent?: boolean
  actions?: NotificationAction[]
  onClick?: (notification: Notification) => void
}

export interface NotificationStore {
  notifications: Notification[]
  addNotification: (options: NotificationOptions) => string
  removeNotification: (id: string) => void
  clearNotifications: () => void
  updateNotification: (id: string, updates: Partial<Notification>) => void
}